
var chakan = document.querySelectorAll('#sList>div a')
var tupian = document.querySelectorAll('#sList>div img')
var biaoti = document.querySelectorAll('#sList>div h3')
var jiage = document.querySelectorAll('#sList>div h4 span')
chakan.forEach(function (ele, index) {
    ele.onclick = function () {
        var obj = {
            id: index + 1,
            img_src: tupian[index].src,
            title: biaoti[index].innerHTML,
            price: jiage[index].innerHTML,

        }
        localStorage.setItem('detial', JSON.stringify(obj))
    }
})
